package com.jtech.together.model;

import cn.bmob.newim.bean.BmobIMExtraMessage;
import cn.bmob.newim.bean.BmobIMMessage;

/**
 * 添加好友消息-im扩展消息
 * Created by wuxubaiyang on 2017/5/13.
 */

public class AddFriendMessage extends BmobIMExtraMessage {
    public static final String MESSAGE_TYPE_ADD_FRIEND = "add";

    @Override
    public String getMsgType() {
        //设置消息类型为添加好友
        return MESSAGE_TYPE_ADD_FRIEND;
    }

    @Override
    public boolean isTransient() {
        return false;
    }

    /**
     * 判断是否为添加好友的消息
     *
     * @param imMessage
     * @return
     */
    public static boolean isAddFriend(BmobIMMessage imMessage) {
        return isAddFriend(imMessage.getMsgType());
    }

    /**
     * 判断是否为添加好友的消息
     *
     * @param type
     * @return
     */
    public static boolean isAddFriend(String type) {
        return MESSAGE_TYPE_ADD_FRIEND.equals(type);
    }
}